<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>DBtoDoc-登陆</title>
  <link rel="stylesheet" href="/layui/css/layui.css">
  <script src="/layui/layui.js"></script>
</head>
<body>
<div style="width: 70vw;margin: 15px auto;">
  <div style="width: 100%;height: 220px;">
    <div class="layui-anim layui-anim-upbit" style="width: 210px;margin: 0 auto;">
      <img src="/favicon.png" style="width: 200px;height: 200px;">
    </div>
  </div>
  <div style="float: left;">
    <br>
    <p class="layui-anim layui-anim-up" style="line-height: 35px;font-size: 22px;">
      什么是 DBtoDoc ？<br>
      DBtoDoc是一个<b style="color: red">基于数据库注释</b>导出为文档的应用<br>
      为什么要使用 DBtoDoc ？<br>
      参与过运维的朋友可能知道，复杂的系统中由于缺少数据库说明，<br>
      处理运维、修数往往头疼找到祖传文档而部分字段解释不清楚。<br>
      DBtoDoc 应运而生，快来体验DBtoDoc导出最新说明文档吧！<br>
    </p>
  </div>
  <div style="float: left;margin-top: 20px;" class="layui-anim layui-anim-upbit">
    <h2 style="text-align: center;">DBtoDoc登陆</h2><br>
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-block">
          <input type="text" name="username" required lay-verify="required" placeholder="请输入账号" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
          <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">DBtoDoc</div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script>
  layui.use(['form', 'jquery'], function () {
    var form = layui.form;
    var $ = layui.jquery;
    //监听提交
    form.on('submit(formDemo)', function (data) {

      $.ajax({
        data: data.field,
        url: '/login',
        type: 'post',
        success: function (data) {
          layer.msg(data.msg);
          if (data.code == 0) {
            window.setTimeout(function () {
              window.location.href = '/main'
            }, 1300)
          }
        }
      })
      return false;
    });
  });
</script>
</body>
</html>
